package com.wxxymaker.edu;

import com.blade.Blade;
import com.blade.event.EventType;
import com.blade.mvc.WebContext;
import com.wxxymaker.edu.hook.CourseInfoHook;
import com.wxxymaker.edu.hook.CourseSetHook;
import com.wxxymaker.edu.hook.LoginHook;
import com.wxxymaker.edu.service.SysRecordService;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: soft
 * @Date: 2018/7/23 13:29
 * @Desc: 启动类
 */
@Slf4j
public class EduApp {
    public static void main(String[] args) {
        Blade.of()
                .on(EventType.SESSION_CREATED, event -> {
                    SysRecordService recordService = WebContext.blade().ioc().getBean(SysRecordService.class);
                    recordService.addView();
                    log.info("--- build a new session ---");
                })
                .use(new LoginHook(),
                        new CourseInfoHook(),
                        new CourseSetHook())
                .start(EduApp.class, args);
    }
}
